package com.huadao.cart_ccs.data.bo;

import com.huadao.cart_ccs.R;
import com.huadao.cart_ccs.main.CartApplication;

//液位仪
public class LiquidLevelBO extends BaseBO {
    private byte status;

    public static final byte ModularType_LiquidLevel=0x07;
    public static final byte liquidLevel_NO1 = 0x01;

    public static final byte read= (byte) 0xFF;//读

    public static final byte LiquidLevel_Error= (byte) 0x00;//异常
    public static final byte LiquidLevel_Ok= (byte) 0x01;//正常；

    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }

    @Override
    protected String getOrderStr() {
        String orderStr = null;
        if (order == read) {
            orderStr = CartApplication.getInstance().getString(R.string.read);
        }
        return orderStr;
    }

    @Override
    protected String getModularTypeStr() {
        return CartApplication.getInstance().getString(R.string.liquid_level_meter);
    }

    @Override
    protected String getOrderContentStr() {
        return getLiquidStatus(status);
//        String statusSrt = getLiquidStatus(status);
//        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append("状态:");
//        stringBuilder.append(statusSrt);
//        return stringBuilder.toString();
    }

    public static String getLiquidStatus(byte status){
        String statusSrt;
        if (status == LiquidLevel_Error) {
            statusSrt = CartApplication.getInstance().getString(R.string.liquidLevel_Error);
        } else if (status == LiquidLevel_Ok) {
            statusSrt = CartApplication.getInstance().getString(R.string.liquidLevel_Ok);
        } else {
            statusSrt = CartApplication.getInstance().getString(R.string.unknow);
        }
        return statusSrt;
    }
}
